3.436 \(\int \cos ^6(c+d x) (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=87 \[ \frac{(a-b) \sin (c+d x) \cos ^5(c+d x)}{6 d}+\frac{(5 a+b) \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac{(5 a+b) \sin (c+d x) \cos (c+d x)}{16 d}+\frac{1}{16} x (5 a+b) \]

[Out]

((5*a + b)*x)/16 + ((5*a + b)*Cos[c + d*x]*Sin[c + d*x])/(16*d) + ((5*a + b)*Cos[c + d*x]^3*Sin[c + d*x])/(24*
d) + ((a - b)*Cos[c + d*x]^5*Sin[c + d*x])/(6*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0551299, antiderivative size = 87, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3675, 385, 199, 203} \[ \frac{(a-b) \sin (c+d x) \cos ^5(c+d x)}{6 d}+\frac{(5 a+b) \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac{(5 a+b) \sin (c+d x) \cos (c+d x)}{16 d}+\frac{1}{16} x (5 a+b) \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^6*(a + b*Tan[c + d*x]^2),x]

[Out]

((5*a + b)*x)/16 + ((5*a + b)*Cos[c + d*x]*Sin[c + d*x])/(16*d) + ((5*a + b)*Cos[c + d*x]^3*Sin[c + d*x])/(24*
d) + ((a - b)*Cos[c + d*x]^5*Sin[c + d*x])/(6*d)

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Simp[(x*(a + b*x^n)^(p + 1))/(a*n*(p + 1)), x] + Dist[(n*(p +
 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (In
tegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[p]
)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a+b x^2}{\left (1+x^2\right )^4} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac{(5 a+b) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^3} \, dx,x,\tan (c+d x)\right )}{6 d}\\ &=\frac{(5 a+b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac{(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac{(5 a+b) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{8 d}\\ &=\frac{(5 a+b) \cos (c+d x) \sin (c+d x)}{16 d}+\frac{(5 a+b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac{(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}+\frac{(5 a+b) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{16 d}\\ &=\frac{1}{16} (5 a+b) x+\frac{(5 a+b) \cos (c+d x) \sin (c+d x)}{16 d}+\frac{(5 a+b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac{(a-b) \cos ^5(c+d x) \sin (c+d x)}{6 d}\\ \end{align*}

Mathematica [A]  time = 0.21104, size = 74, normalized size = 0.85 \[ \frac{3 (15 a+b) \sin (2 (c+d x))+(9 a-3 b) \sin (4 (c+d x))+a \sin (6 (c+d x))+60 a c+60 a d x-b \sin (6 (c+d x))+12 b d x}{192 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^6*(a + b*Tan[c + d*x]^2),x]

[Out]

(60*a*c + 60*a*d*x + 12*b*d*x + 3*(15*a + b)*Sin[2*(c + d*x)] + (9*a - 3*b)*Sin[4*(c + d*x)] + a*Sin[6*(c + d*
x)] - b*Sin[6*(c + d*x)])/(192*d)

________________________________________________________________________________________

Maple [A]  time = 0.085, size = 102, normalized size = 1.2 \begin{align*}{\frac{1}{d} \left ( b \left ( -{\frac{\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{5}}{6}}+{\frac{\sin \left ( dx+c \right ) }{24} \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{3}+{\frac{3\,\cos \left ( dx+c \right ) }{2}} \right ) }+{\frac{dx}{16}}+{\frac{c}{16}} \right ) +a \left ({\frac{\sin \left ( dx+c \right ) }{6} \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{5}+{\frac{5\, \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{4}}+{\frac{15\,\cos \left ( dx+c \right ) }{8}} \right ) }+{\frac{5\,dx}{16}}+{\frac{5\,c}{16}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x)

[Out]

1/d*(b*(-1/6*sin(d*x+c)*cos(d*x+c)^5+1/24*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+1/16*d*x+1/16*c)+a*(1/6*(co
s(d*x+c)^5+5/4*cos(d*x+c)^3+15/8*cos(d*x+c))*sin(d*x+c)+5/16*d*x+5/16*c))

________________________________________________________________________________________

Maxima [A]  time = 1.70511, size = 131, normalized size = 1.51 \begin{align*} \frac{3 \,{\left (d x + c\right )}{\left (5 \, a + b\right )} + \frac{3 \,{\left (5 \, a + b\right )} \tan \left (d x + c\right )^{5} + 8 \,{\left (5 \, a + b\right )} \tan \left (d x + c\right )^{3} + 3 \,{\left (11 \, a - b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{6} + 3 \, \tan \left (d x + c\right )^{4} + 3 \, \tan \left (d x + c\right )^{2} + 1}}{48 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/48*(3*(d*x + c)*(5*a + b) + (3*(5*a + b)*tan(d*x + c)^5 + 8*(5*a + b)*tan(d*x + c)^3 + 3*(11*a - b)*tan(d*x
+ c))/(tan(d*x + c)^6 + 3*tan(d*x + c)^4 + 3*tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 1.67815, size = 167, normalized size = 1.92 \begin{align*} \frac{3 \,{\left (5 \, a + b\right )} d x +{\left (8 \,{\left (a - b\right )} \cos \left (d x + c\right )^{5} + 2 \,{\left (5 \, a + b\right )} \cos \left (d x + c\right )^{3} + 3 \,{\left (5 \, a + b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/48*(3*(5*a + b)*d*x + (8*(a - b)*cos(d*x + c)^5 + 2*(5*a + b)*cos(d*x + c)^3 + 3*(5*a + b)*cos(d*x + c))*sin
(d*x + c))/d

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**6*(a+b*tan(d*x+c)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 5.93165, size = 5072, normalized size = 58.3 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/96*(3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*ta
n(c))*tan(d*x)^6*tan(c)^6 + 30*a*d*x*tan(d*x)^6*tan(c)^6 + 6*b*d*x*tan(d*x)^6*tan(c)^6 + 3*pi*b*sgn(-2*tan(d*x
)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^6 + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)
^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^4 + 9*pi*b*s
gn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)
^4*tan(c)^6 + 6*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^6*tan(c)^6 - 6*b*arctan(-(tan(d*x
) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6*tan(c)^6 + 90*a*d*x*tan(d*x)^6*tan(c)^4 + 18*b*d*x*tan(d*x)^6*ta
n(c)^4 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^4 +
90*a*d*x*tan(d*x)^4*tan(c)^6 + 18*b*d*x*tan(d*x)^4*tan(c)^6 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan
(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^6 + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*t
an(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^2 + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 -
 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 18*b*arctan(
(tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^6*tan(c)^4 - 18*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*ta
n(c) + 1))*tan(d*x)^6*tan(c)^4 - 66*a*tan(d*x)^6*tan(c)^5 + 6*b*tan(d*x)^6*tan(c)^5 + 9*pi*b*sgn(2*tan(d*x)^2*
tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^6 + 18
*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan(c)^6 - 18*b*arctan(-(tan(d*x) - tan(c))/(t
an(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^6 - 66*a*tan(d*x)^5*tan(c)^6 + 6*b*tan(d*x)^5*tan(c)^6 + 90*a*d*x*tan(d
*x)^6*tan(c)^2 + 18*b*d*x*tan(d*x)^6*tan(c)^2 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(
d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^2 + 270*a*d*x*tan(d*x)^4*tan(c)^4 + 54*b*d*x*tan(d*x)^4*tan(c)^4 + 27*pi*b*
sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 90*a*d*x*tan(d*x
)^2*tan(c)^6 + 18*b*d*x*tan(d*x)^2*tan(c)^6 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*
x) - 2*tan(c))*tan(d*x)^2*tan(c)^6 + 3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*
x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6 + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan
(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 18*b*arctan((tan(d*x) + tan(c))/(tan(
d*x)*tan(c) - 1))*tan(d*x)^6*tan(c)^2 - 18*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6*tan
(c)^2 - 80*a*tan(d*x)^6*tan(c)^3 - 16*b*tan(d*x)^6*tan(c)^3 + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*ta
n(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^4 + 54*b*arctan((tan(d*x) + t
an(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan(c)^4 - 54*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*ta
n(d*x)^4*tan(c)^4 + 90*a*tan(d*x)^5*tan(c)^4 - 78*b*tan(d*x)^5*tan(c)^4 + 90*a*tan(d*x)^4*tan(c)^5 - 78*b*tan(
d*x)^4*tan(c)^5 + 3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan
(d*x) - 2*tan(c))*tan(c)^6 + 18*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^6 - 18*b
*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^6 - 80*a*tan(d*x)^3*tan(c)^6 - 16*b*tan(
d*x)^3*tan(c)^6 + 30*a*d*x*tan(d*x)^6 + 6*b*d*x*tan(d*x)^6 + 3*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(
c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6 + 270*a*d*x*tan(d*x)^4*tan(c)^2 + 54*b*d*x*tan(d*x)^4*tan(c)^2 + 27*p
i*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 270*a*d*x*ta
n(d*x)^2*tan(c)^4 + 54*b*d*x*tan(d*x)^2*tan(c)^4 + 27*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*
tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^4 + 30*a*d*x*tan(c)^6 + 6*b*d*x*tan(c)^6 + 3*pi*b*sgn(-2*tan(d*x)^2*tan
(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^6 + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan
(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4 + 6*b*arctan((tan(d*x) + tan(c))/(tan
(d*x)*tan(c) - 1))*tan(d*x)^6 - 6*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6 - 30*a*tan(d
*x)^6*tan(c) - 6*b*tan(d*x)^6*tan(c) + 27*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan
(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2 + 54*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c)
 - 1))*tan(d*x)^4*tan(c)^2 - 54*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^2 + 90*
a*tan(d*x)^5*tan(c)^2 + 18*b*tan(d*x)^5*tan(c)^2 - 240*a*tan(d*x)^4*tan(c)^3 + 144*b*tan(d*x)^4*tan(c)^3 + 9*p
i*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan
(c)^4 + 54*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^4 - 54*b*arctan(-(tan(d*x) -
tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^4 - 240*a*tan(d*x)^3*tan(c)^4 + 144*b*tan(d*x)^3*tan(c)^4 + 9
0*a*tan(d*x)^2*tan(c)^5 + 18*b*tan(d*x)^2*tan(c)^5 + 6*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan
(c)^6 - 6*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(c)^6 - 30*a*tan(d*x)*tan(c)^6 - 6*b*tan(d*x
)*tan(c)^6 + 90*a*d*x*tan(d*x)^4 + 18*b*d*x*tan(d*x)^4 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2
 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4 + 270*a*d*x*tan(d*x)^2*tan(c)^2 + 54*b*d*x*tan(d*x)^2*tan(c)^2 + 27*pi*b*
sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2 + 90*a*d*x*tan(c)^
4 + 18*b*d*x*tan(c)^4 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^
4 + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(
c))*tan(d*x)^2 + 18*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4 - 18*b*arctan(-(tan(d*x) -
tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4 + 30*a*tan(d*x)^5 + 6*b*tan(d*x)^5 - 90*a*tan(d*x)^4*tan(c) - 18*b*t
an(d*x)^4*tan(c) + 9*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*ta
n(d*x) - 2*tan(c))*tan(c)^2 + 54*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^2 - 54*
b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 + 240*a*tan(d*x)^3*tan(c)^2 - 144*b*t
an(d*x)^3*tan(c)^2 + 240*a*tan(d*x)^2*tan(c)^3 - 144*b*tan(d*x)^2*tan(c)^3 + 18*b*arctan((tan(d*x) + tan(c))/(
tan(d*x)*tan(c) - 1))*tan(c)^4 - 18*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(c)^4 - 90*a*tan(d
*x)*tan(c)^4 - 18*b*tan(d*x)*tan(c)^4 + 30*a*tan(c)^5 + 6*b*tan(c)^5 + 90*a*d*x*tan(d*x)^2 + 18*b*d*x*tan(d*x)
^2 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2 + 90*a*d*x*tan(
c)^2 + 18*b*d*x*tan(c)^2 + 9*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(
c)^2 + 3*pi*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*t
an(c)) + 18*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2 - 18*b*arctan(-(tan(d*x) - tan(c))/
(tan(d*x)*tan(c) + 1))*tan(d*x)^2 + 80*a*tan(d*x)^3 + 16*b*tan(d*x)^3 - 90*a*tan(d*x)^2*tan(c) + 78*b*tan(d*x)
^2*tan(c) + 18*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(c)^2 - 18*b*arctan(-(tan(d*x) - tan(c))
/(tan(d*x)*tan(c) + 1))*tan(c)^2 - 90*a*tan(d*x)*tan(c)^2 + 78*b*tan(d*x)*tan(c)^2 + 80*a*tan(c)^3 + 16*b*tan(
c)^3 + 30*a*d*x + 6*b*d*x + 3*pi*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c)) + 6
*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1)) - 6*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))
+ 66*a*tan(d*x) - 6*b*tan(d*x) + 66*a*tan(c) - 6*b*tan(c))/(d*tan(d*x)^6*tan(c)^6 + 3*d*tan(d*x)^6*tan(c)^4 +
3*d*tan(d*x)^4*tan(c)^6 + 3*d*tan(d*x)^6*tan(c)^2 + 9*d*tan(d*x)^4*tan(c)^4 + 3*d*tan(d*x)^2*tan(c)^6 + d*tan(
d*x)^6 + 9*d*tan(d*x)^4*tan(c)^2 + 9*d*tan(d*x)^2*tan(c)^4 + d*tan(c)^6 + 3*d*tan(d*x)^4 + 9*d*tan(d*x)^2*tan(
c)^2 + 3*d*tan(c)^4 + 3*d*tan(d*x)^2 + 3*d*tan(c)^2 + d)